﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using ClassSite.Models;

namespace ClassSite.Models
{
      public class Sample : DropCreateDatabaseIfModelChanges<ClassSiteEntities>
      {
            protected override void Seed ( ClassSiteEntities context )
            {
                  new List<Users>
                  {
			new Users{ usersID=1384 , password="liu1990" , gender="男" , name="刘松" , nickName="liusong" ,  relationStatus="secret" , role="administrator"},
			new Users{ usersID=1385 , password="zhaojun" ,gender="男" , name="赵军" , nickName="zhaojun" ,  relationStatus="secret" , role="administrator"},
			new Users{ usersID=1386 , gender="男" , name="张勋" , nickName="zhangxun", password="zhangxun" , relationStatus="secret" , role="administrator"},
			new Users{ usersID=1387 , gender="男" , name="陈冲" , nickName="chenchong" , password="chenchong" , relationStatus="secret" , role="administrator"},
			new Users{ usersID=1388 , gender="男" , name="杜双全" , nickName="dushuangquan" , password="dushuangquan" , relationStatus="secret" , role="administrator"},
			new Users{ usersID=1389 , gender="男" , name="章诗韵" , nickName="zhangshiyun" , password="zhangshiyun" , relationStatus="secret" , role="administrator" },
			new Users{ usersID=1390 , gender="女" , name="王珍珍" , nickName="wangzhenzhen" , password="wangzhenzhen" , relationStatus="secret" , role="administrator"}
                  }.ForEach ( a => context.Userss.Add ( a ) );

                  new List<Feeling>
                  {
			new Feeling{ feelingID=1 , fTime=DateTime.Parse ("2013-10-5 07:13:04"), fContent="今天我心情越快！" , usersID=1384},
			new Feeling{ feelingID=2 , fTime=DateTime.Parse ("2013-10-8 11:05:12") , fContent="今天我们班出去秋游了！" , usersID=1385},
			new Feeling{ feelingID=3 , fTime=DateTime.Parse ("2013-10-12 13:04:21") , fContent="好想睡到自然醒！" , usersID=1384},
			new Feeling{ feelingID=4 , fTime=DateTime.Parse ("2013-10-20 21:35:05") , fContent="待到徐峥长发及腰，暑假再结束，可好！" , usersID=1386},
			new Feeling{ feelingID=5 , fTime=DateTime.Parse ("2013-10-31 23:45:56") , fContent="读万卷书不如行万里路！" , usersID=1387}
                  }.ForEach ( a => context.Feelings.Add ( a ) );

                  context.SaveChanges ( );
            }
      }
}